import Vue from 'vue'

const axios = Vue.$axios

export const GetListWord = () => {
    return axios({
        url: '/words',
        method: 'get',
    })
}

export const GetOneWord = (id) => {
    return axios({
        url: '/words/' + id,
        method: 'get'
    })
}

export const CreateOneWord = (data) => {
    return axios({
        url: '/words',
        method: 'post',
        data: data
    })
}

export const UpdateOneWord = (data) => {
    return axios({
        url: '/words' + '/' + data.id,
        method: 'put',
        data: data
    })
}

export const PatchOneWord = (data) => {
    return axios({
        url: '/words' + "/" + data.id,
        method: 'patch',
        data: data
    })
}

export const RemoveOneWord = (id) => {
    return axios({
        url: '/words/' + id,
        method: 'delete',
    })
}